<?php 
Yii::app()->clientScript->registerScript('Custno',"custno='$model->custno'",  CClientScript::POS_HEAD); 
Yii::app()->clientScript->registerScript('type',
        "var type=".DOCTYPE_CUST.";",  CClientScript::POS_HEAD);
Yii::app()->clientScript->registerScript('data',"            
                var locno=null;
                var dispatch=null;",CClientScript::POS_HEAD);
?>
<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl.'/js/app/customers.js',CClientScript::POS_BEGIN);?>
<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl.'/js/app/salesPortal/locations.js',CClientScript::POS_BEGIN);?>
<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl.'/js/app/documents.js',CClientScript::POS_BEGIN);?>
<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl.'/js/app/customerGlobalContacts.js',CClientScript::POS_BEGIN);?>
<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl.'/js/app/salesPortal/customerContracts.js',CClientScript::POS_BEGIN);?>



<div id="left-col">
    <?php $this->widget('CustomerMenu',array(
        'model'=>$model,
        'showCreate'=>true,
    ))?>
    
    

</div>

<div id="right-col">

    <div class="wrap">
        <div class="container">
            
            
            
            <div class="inside">
                <?php $this->renderPartial('_view',array(
                    'customer'=>$model,
                ))?>
                <ul id="tab" class="tabs tabs-with-summary">
                    <li class='active'><a id="tabUpdate" href="#update">Info</a></li>
                    <li class=''><a id="tabLocation" href="#locations">Location</a></li>
                    <li class=''><a id="tabDocument" href="#document">Documents</a></li>                                   
                    <li><a id="tabGlobalContacts" href="#globalcontacts">Global Contacts</a> </li> 
                    <li><a id="tabContracts" href="#contracts">Contracts</a> </li>
                </ul>
                <br/>
                <div id="update">
                <?php $this->renderPartial('_form',array(
                    'model'=>$model,
                ));?>
            </div>
             <div id="locations">
                <div class="form">
                    <div class ="row">
                        <label>Status</label>
                        <?php 
                            $data = array(            
                                '0'=>'Active',
                                '1'=>'Inactive',
                                '-1'=>'Pending',
                            );
                            echo CHtml::dropDownList('statuslc','',$data);  
                        ?>
                    </div>
                </div>
                    <div id="location-list"></div>
                </div>
                <div id="document">
                    <div id="document-list">
                        
                    </div>
                </div>
                
                <div id="globalcontacts">
                       <a id="createGC" class="add-button">Add Global Contact </a>
                    <div id="globalcontacts-list">
                        
                    </div>
                </div>
                <div id="contracts">

                    <div class="form">
                                        
                        <div class="row">
                            <?php echo CHtml::label('Contract Report Type', 'contractType'); ?>
                            <?php echo CHtml::dropDownList('contractType','',ContractType::getListData()) ?>
                        </div>
                        <div class="row short">
                            <?php echo CHtml::label('Contract Start Date', 'contractstartdate'); ?>
                            <?php
                            $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                                'name' => 'contractstartdate',
                                'value' =>'',
                                'options' => array('dateFormat' => 'yy-mm-dd'),
                            ));
                            ?>

                        </div>
                        <div class="row short">
                            <?php echo CHtml::label('Contract End Date', 'contractenddate'); ?>
                            <?php
                            $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                                'name' => 'contractenddate',
                                'value' =>'',
                                'options' => array('dateFormat' => 'yy-mm-dd'),
                            ));
                            ?>

                        </div>
                        <div class="row">
                            <label>Actions: </label>
                            <div class="model-data">
                                <a class="print-button" onclick="getPDF()";> View & Print</a>|
                                <a  class="email-button" onclick="createMailPanel()";> Email</a><br/>
                            </div>
                        </div>
                        <div class ="row">
                            <label>Status</label>
                            <?php 
                            $criteria = new CDbCriteria();
                            $criteria->addColumnCondition(array('inactive'=>0));
                            $criteria->order = 'description ASC';
                            $data = CHtml::listData(ContractStatus::model()->findAll($criteria), 'id', 'description');
                            echo CHtml::dropDownList('statuscc','',$data);  ?>
                        </div>  
                    </div>
                    <div id="contract-list"></div>
                </div>
                
            </div><!-- inside -->
        </div><!-- container -->
    </div><!-- wrap -->
    <?php $this->renderPartial('application.views.copyright'); ?>
</div> <!-- left-col -->